package model

import (
	"gorm.io/gorm"
	"time"
)

type Orders struct {
	Id         uint           `gorm:"column:id;type:bigint UNSIGNED;comment:id;primaryKey;not null;" json:"id"`                                          // id
	UserId     uint           `gorm:"column:user_id;type:bigint UNSIGNED;comment:用户id;not null;default:0;" json:"user_id"`                               // 用户id
	HouseId    uint           `gorm:"column:house_id;type:bigint UNSIGNED;comment:房源id;not null;default:0;" json:"house_id"`                             // 房源id
	Price      uint           `gorm:"column:price;type:int UNSIGNED;comment:价格;not null;default:0;" json:"price"`                                        // 价格
	VoucherUrl string         `gorm:"column:voucher_url;type:varchar(300);comment:凭证;not null;" json:"voucher_url"`                                      // 凭证
	Status     uint           `gorm:"column:status;type:bigint UNSIGNED;comment:状态: 1:并锁定 2:待审核 3:签约 4:尾款 5:过户 6:完成 ;not null;default:1;" json:"status"` // 状态: 1:并锁定 2:待审核 3:签约 4:尾款 5:过户 6:完成
	CreatedAt  time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt  time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt  gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (o *Orders) TableName() string {
	return "orders"
}
